package sadTalker

import (
	"time"
	"web_runner/ai_model/sadTalker/scripts"
)

type Job struct {
	ID         int64               `json:"id"`
	AudioFile  string              `json:"audioFile"`
	ImageFile  string              `json:"imageFile"`
	OutputFile string              `json:"outputFile"`
	CallScript *scripts.CallScript `json:"callScript"`
	IsDone     bool                `json:"isDone"`
}

// AIModelRunner 维护指定的AI模型下 所有运行信息
type AIModelRunner struct {
	workDir string
	//查看历史，起缓存作用
	historyJobs map[string]Job
}

var DefaultCallScript = ""

func (ar AIModelRunner) NewJob(audioFile, imageFile string) *Job {
	return &Job{
		ID:         time.Now().Unix(),
		AudioFile:  audioFile,
		ImageFile:  imageFile,
		CallScript: scripts.Extcrop_512.ToScript("./", audioFile, imageFile, "output"),
	}
}
